package cn.com.yusys.yusp.admin.service;

import cn.com.yusys.yusp.admin.repository.mapper.LeaderShipCockpitMapper;
import cn.com.yusys.yusp.admin.repository.mapper.WcrmGridCustRefMapper;
import cn.com.yusys.yusp.commons.mapper.QueryModel;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.SqlSessionTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StopWatch;

import java.util.List;
import java.util.Map;


/**
 * @author zoie
 */
@Service
public class LeaderShipCockpitService {
    private Logger logger = LoggerFactory.getLogger(LeaderShipCockpitService.class);
    @Autowired
    private LeaderShipCockpitMapper leaderShipCockpitMapper;

    /**
     * 网格每周新增客户数排名
     * @return
     */
    @Transactional(readOnly = true)
    public List<Map<String, Object>> queryAddCustRank(QueryModel queryModel) {
        List<Map<String, Object>> list = leaderShipCockpitMapper.queryAddCustRank(queryModel);
        return list;
    }

    /**
     * 当前重点考核指标排名
     * @param queryModel
     * @return
     */
    @Transactional(readOnly = true)
    public List<Map<String, Object>> queryImportIndexRank(QueryModel queryModel) {
        List<Map<String, Object>> list = leaderShipCockpitMapper.queryImportIndexRank(queryModel);
        return list;
    }

    /**
     * 网格客户模拟利润提升
     * @return
     */
    @Transactional(readOnly = true)
    public List<Map<String, Object>> querySimuProfitRank() {
        List<Map<String, Object>> list = leaderShipCockpitMapper.querySimuProfitRank();
        return list;
    }

    /**
     * 全行网格概览
     * @return
     */
    @Transactional(readOnly = true)
    public List<Map<String, Object>> queryGridOverviewInfo() {
        List<Map<String, Object>> list = leaderShipCockpitMapper.queryGridOverviewInfo();
        return list;
    }

    /**
     * 网格黏性排名
     * @param queryModel
     * @return
     */
    @Transactional(readOnly = true)
    public List<Map<String, Object>> queryGridViscosityRank(QueryModel queryModel) {
        List<Map<String, Object>> list = leaderShipCockpitMapper.queryGridViscosityRank(queryModel);
        return list;
    }

    /**
     * 网格走访排名
     * @return
     */
    @Transactional(readOnly = true)
    public List<Map<String, Object>> queryGridVisitRank() {
        List<Map<String, Object>> list = leaderShipCockpitMapper.queryGridVisitRank();
        return list;
    }
}